package com.hh.hot100;

/**
 * @Author hanghao
 * @Date 2023/6/27 11:59
 * @Version 1.0
 */

public class No560 {
    public int subarraySum(int[] nums, int k) {
        int count = 0;
        int len = nums.length;
        for (int left = 0; left < len; left++) {
            int sum = 0;
            for (int right = left; right < len; right++) {
                sum += nums[right];
                if(sum == k) {
                    count++;
                }
            }
        }
        return count;
    }
}
